package testJdk.base.juc_test.multi_threading.thread;

import java.util.ArrayList;
import java.util.Random;

/**
 * @ClassName : learn_jdk.multi_threading.thread.TestMul
 * @Description : 类描述
 * Created by cyd on 2021-03-30 23:57:07
 */
public class Test01 {
    public static void main(String[] args) throws InterruptedException {
        long start = System.currentTimeMillis();
        Random random = new Random();
        ArrayList<Integer> arrayList = new ArrayList<>();

        Thread thread = new Thread() {
            @Override
            public void run() {
                for (int i = 0; i < 100000; i++) {
                    arrayList.add(random.nextInt());

                }
            }
        };
        thread.start();
        thread.join();

        System.out.println(System.currentTimeMillis() - start);
        System.out.println(arrayList.size());
    }
}
